﻿using System;
using System.ComponentModel.DataAnnotations;
using WeBlog.Attributes;
using WeBlog.Interfaces;

namespace WeBlog.Models
{
    public class PostComment : IModel
    {
        [Key]
        public int PostCommentId { get; set; }

        [Required]
        public int PostId { get; set; }
        public virtual Post Post { get; set; }

        public int? UserId { get; set; }

        [Required]
        [StringLength(255)]
        [EmailRegex]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [StringLength(255)]
        public string Author { get; set; }
        
        [StringLength(255)]
        [UrlRegex]
        [DataType(DataType.Url)]
        public string Website { get; set; }

        [Required]
        [Column(TypeName = "ntext")]
        public string Content { get; set; }

        [Required]
        public DateTime DateTime { get; set; }        

        [StringLength(15)]
        public string IpAddress { get; set; }

        public CommentStatus CommentStatus { get; set; }
    }
}
